import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class dragonTurtle here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class dragonTurtle extends Turtle
{
    /**
     * Act - do whatever the dragonTurtle wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public dragonTurtle(){
        penDown();
    }
    public void act() 
    {
        // Add your action code here.
    }    
    void Y(int n, double sideLen){
        if(n == 0)
            move(sideLen);
        else{
            move(sideLen);
            X(n-1, sideLen);
            turn(-90);
            Y(n-1, sideLen);
        }
    }
    void X(int n, double sideLen){
        if(n == 0){
            move(sideLen);
        }else{
            X(n-1,sideLen);
            turn(90);
            Y(n-1,sideLen);
            move(sideLen);
        }
    }
    
    public void dragonCurve(int n, double sideLen){
        turn(n * 45);
        move(sideLen);
        X(n-1, sideLen);
        turn(- n * 45);
        turn(-90);
    }
}
